package test;

enum Singleton{  
    INSTANCE{
    	 @Override  
         protected void read() {  
             System.out.println("read");  
         }  
   
         @Override  
         protected void write() {  
             System.out.println("write");  
         }  
         
    } ;
    protected abstract void read();  
    protected abstract void write(); 
}  
  
public class Singleton3 {  
    public static void main(String[] args) {  
        Singleton s=Singleton.INSTANCE;  
        s.read();
        Singleton s2=Singleton.INSTANCE;  
        System.out.println(s==s2);  
    }  
}  